<div class="easyui-layout" data-options="fit:true">
    <div data-options="region:'center'">
        <table id="paybackPlanList"></table>
    </div>
</div>

<script type="text/javascript">
    var rows = $('#list').datagrid('getChecked');
    var paybackPlanListUrl1 = '/paybackPlan/listByTargetId?targetId=' + rows[0].id;
    var columns1 = [[
        {
            field: 'qs',
            title: '期数',
        }, {
            field: 'bj',
            title: '应还本金(元)',
            align: 'right',
            formatter: function (value, row, index) {
                if (value) {
                    return value.formatMoney();
                }
                return value;
            }
        }, {
            field: 'lx',
            title: '应还利息(元)',
            align: 'right',
            formatter: function (value, row, index) {
                if (value) {
                    return value.formatMoney();
                }
                return value;
            }
        }, {
            field: 'totalAmount',
            title: '应还总额(元)',
            align: 'right',
            formatter: function (value, row, index) {
                if (value) {
                    return value.formatMoney();
                }
                return value;
            }
        }, {
            field: 'yhkr',
            title: '还款截止日期',
        }, {
            field: 'hkrq',
            title: '实际还款时间',
        }, {
            field: 'yqts',
            title: '逾期天数',
        }, {
            field: 'state',
            title: '状态',
            formatter: function (value, rows, index) {
                if (value) {
                    if (value == '1' || value == '3') {
                        return "已还款";
                    } else if (value == '0' || value == '2' || value == '4') {
                        return "未还款";
                    }
                }
            }
        }
    ]];

    $('#paybackPlanList').datagrid({url: paybackPlanListUrl1, columns: columns1});

</script>